package cn.dliyy.warehouse.bean;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Type;
import org.hibernate.validator.constraints.NotEmpty;
import org.joda.time.DateTime;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat.ISO;
import org.springframework.format.annotation.NumberFormat;
import org.springframework.stereotype.Component;

import cn.dliyy.base.bean.IdEntity;

@Entity
@Table
@Component
public class SItems extends IdEntity {
  private static final long serialVersionUID = 5801788779249940365L;
  @Column
  @NotEmpty
  private String goodsid;
  @Column
  @NotEmpty
  private String cateid;
  @Column
  @NotEmpty
  private String handlerid;// 经办人
  @Column
  @NotEmpty
  private String operatorid;
  @Column
  @NotEmpty
  private String warehouseid;
  @Column
  private String dealerid;// 经销商
  @Column
  private String brandid;// 品牌
  @Column
  @NotNull
  // @NotEmpty
  // @Digits(fraction = 2, integer = 9)
  @NumberFormat(pattern = "####.##")
  private Double price;
  @Column
  @NotNull
  private Integer number;
  @Column
  @DateTimeFormat(iso = ISO.DATE)
  @Type(type = "org.joda.time.contrib.hibernate.PersistentDateTime")
  private DateTime handlerDate;// 进货出货日期
  @Column
  @DateTimeFormat(iso = ISO.DATE_TIME)
  @Type(type = "org.joda.time.contrib.hibernate.PersistentDateTime")
  private DateTime makeDate;
  @Column
  private String note;
  @Column
  @NotNull
  private Integer type;// 类型?进库or出库
  @Column
  private String reasonid;// 进出库描述

  public String getReasonid() {
    return reasonid;
  }

  public void setReasonid(String reasonid) {
    this.reasonid = reasonid;
  }

  public Integer getType() {
    return type;
  }

  public void setType(Integer type) {
    this.type = type;
  }

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getGoodsid() {
    return goodsid;
  }

  public void setGoodsid(String goodsid) {
    this.goodsid = goodsid;
  }

  public String getCateid() {
    return cateid;
  }

  public void setCateid(String cateid) {
    this.cateid = cateid;
  }

  public String getHandlerid() {
    return handlerid;
  }

  public void setHandlerid(String handlerid) {
    this.handlerid = handlerid;
  }

  public String getOperatorid() {
    return operatorid;
  }

  public void setOperatorid(String operatorid) {
    this.operatorid = operatorid;
  }

  public Double getPrice() {
    return price;
  }

  public void setPrice(Double price) {
    this.price = price;
  }

  public Integer getNumber() {
    return number;
  }

  public void setNumber(Integer number) {
    this.number = number;
  }

  public DateTime getHandlerDate() {
    return handlerDate;
  }

  public void setHandlerDate(DateTime handlerDate) {
    this.handlerDate = handlerDate;
  }

  public DateTime getMakeDate() {
    return makeDate;
  }

  public void setMakeDate(DateTime makeDate) {
    this.makeDate = makeDate;
  }

  public String getNote() {
    return note;
  }

  public void setNote(String note) {
    this.note = note;
  }

  public String getWarehouseid() {
    return warehouseid;
  }

  public void setWarehouseid(String warehouseid) {
    this.warehouseid = warehouseid;
  }

  public String getDealerid() {
    return dealerid;
  }

  public void setDealerid(String dealerid) {
    this.dealerid = dealerid;
  }

  public String getBrandid() {
    return brandid;
  }

  public void setBrandid(String brandid) {
    this.brandid = brandid;
  }

}
